package com.hb.unic.core.context;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ImportResource;

import com.hb.unic.core.context.processor.AfterStartupProcessor;
import com.hb.unic.core.context.processor.BeforeShutdownProcessor;

import lombok.extern.slf4j.Slf4j;

/**
 * 自动配置类
 *
 * @since v1.0，2023/8/26 21:09，create by Mr.Huang.
 */
@Slf4j
@ImportResource({"classpath*:config/service-*-context.xml"})
@MapperScan(basePackages = {"com.hb.**.mapper"})
public class UnicBaseAutoConfiguration {

    /**
     * 应用启动后
     * 
     * @return 结果
     */
    @Bean
    public static AfterStartupProcessor afterStartupProcessor() {
        return new AfterStartupProcessor();
    }

    /**
     * 应用关闭前
     *
     * @return 结果
     */
    @Bean
    public static BeforeShutdownProcessor beforeShutdownProcessor() {
        return new BeforeShutdownProcessor();
    }

}
